import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './assets/css/reset.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import './utils/response'
import * as echarts from 'echarts'
import BaiduMap from 'vue-baidu-map-3x'
const app = createApp(App)
app.use(BaiduMap, {
  ak: 'P4Yv69QrYGaclpatX52sqrN8IGYAVmEQ'
})
// 注册为全局属性
app.config.globalProperties.$echarts = echarts
/*
  vue2.x写法
  Vue.prototype.$echarts = echarts
*/

// 注册图标库
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// element国际化

app
  .use(store)
  .use(router)
  .use(ElementPlus, {
    locale: zhCn
  }) // 使用插件后自动将组件库所有组件注册为全局组件
  .mount('#app')
